package com.mini.constant;

/**
 * @author: zhaocg
 * @created: 2020/12/02 12:10
 */
public enum GoalStatusEnum {

    VALID(0,"有效"),
    INVALID(1,"无效"),
    ;

    private int code ;
    private String desc;

    GoalStatusEnum(int code,String desc){
        this.code = code;
        this.desc = desc;
    }

    public int getCode(){
        return code;
    }
    public String getDesc(){
        return desc;
    }

    public static String getDescByCode(Integer code){
        if(code == null){
            return "";
        }
        for(GoalStatusEnum codeEnum : GoalStatusEnum.values()){
            if(code == codeEnum.getCode()){
                return codeEnum.getDesc();
            }
        }
        return "";
    }

}
